Heston Model Project

Anita Mezzetti

course: Machine Learning for finance

Table of context:

Import packages

Explicit solution of the Heston price equation

In this section, we define the functions needed to find the numberical solution: $$ C(S,T) = S P_1 - K P_2 $$ More details in the report

Stock paths generator

We define the functions needed to create the stock paths using the Heston model dynamic:

Generate Data

- All values fixed apart S0

Monte Carlo simulation

- All values fixed apart S0

Plot MC simulations only to give a graphical idea

Monte Carlo simulation with Antithetic variables

The result with mc and mc_av are quite similar. let us know the difference in terms standard deviation and time needed to compute them

Time analysis for Monte Carlo

Changes with different numbers of simulations

The behaviour is similar for all the numbers of simulations

Error Analysis MC

Machine Learning models

Motivation in combining regression and classification

We start running the simple linear regression, then we add the logistic classification and we plot the differences in order to explain why this combination makes sense. Essentially, this section is an introduction which explain why we decide to combine regression and classification

Classification methods

Logistic Regression

KNN

XGBoost Classifier

Neural Network

As you can see, it OVERFITS => No good method (we leave it only to point out that we have tried but we cannot use a method that overfeats)

Error Classification

Regression methods

First create the dataset for the regression and prepare data

Linear Regression

Ridge Regression

Decision Tree

Random Forest

XGBoost Regression

Analyse errors

Use different Regression methods with S0

ATM area

First we check where is the classification threshold, than we inlude the area around it in the regression.

Linear regression including the ATM area:

XGBoost with area

Add other features

We create a new dataset adding many features. Then we run Logistic Regression and Linear Regression

Stock prices simulation:

Classification

Logistic Regression

S0 fixed and K moves